<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function run1() {
            var num = 10;
            console.log(num);
            return num;
        }

        function run2() {
            var num = 20;
            console.log(num);
        }
        //  run1();
        //  run2();

        console.log(run1());
        console.log(run2());

        //函数封装有类型，可能是功能或计算公式
        var run3 = function(){
            var a = 10, b = 20, c = 30;
            //返回结果
            return a;
        }

        var r = run3();
        console.log(r);
        console.log(run3());


        var num1 = 10 + 20;
        console.log(num1); // 30
        console.log(10 + 20);  // 30
    </script>
</body>

</html>